<template>
  <div>
	  <MyHeader></MyHeader>
     <div class="center_con clearfix">
		<ul class="subnav fl">
			<li><a href="#model01" class="fruit">新鲜水果</a></li>
			<li><a href="#model02" class="seafood">海鲜水产</a></li>
			<li><a href="#model03" class="meet">猪牛羊肉</a></li>
			<li><a href="#model04" class="egg">禽类蛋品</a></li>
			<li><a href="#model05" class="vegetables">新鲜蔬菜</a></li>
			<li><a href="#model06" class="ice">速冻食品</a></li>
		</ul>
		<div class="slide fl">
			<ul class="slide_pics">
				<li><img src="../assets/images/slide.jpg" alt="幻灯片"></li>
				<li><img src="../assets/images/slide02.jpg" alt="幻灯片"></li>
				<li><img src="../assets/images/slide03.jpg" alt="幻灯片"></li>
				<li><img src="../assets/images/slide04.jpg" alt="幻灯片"></li>
			</ul>
			<div class="prev"></div>
			<div class="next"></div>
			<ul class="points"></ul>
		</div>
		<div class="adv fl">
			<a href="#"><img src="../assets/images/adv01.jpg"></a>
			<a href="#"><img src="../assets/images/adv02.jpg"></a>
		</div>
	</div>
	<div class="list_model" v-for="item in data_list" :key="item.id">
		<div class="list_title clearfix">
			<h3 class="fl" id="model01">{{item.cate.name}}</h3>
			<div class="subtitle fl">
				<span>|</span>
				<a href="#">鲜芒</a>
				<a href="#">加州提子</a>
				<a href="#">亚马逊牛油果</a>
			</div>
			<router-link :to="'/list?id='+item.cate.id" class="goods_more fr" id="fruit_more">查看更多</router-link>
		</div>

		<div class="goods_con clearfix">
			<div class="goods_banner fl"><img :src="'http://127.0.0.1:8000'+item.cate.pic"></div>
			<ul class="goods_list fl">
				<li v-for="goods in item.good_list" :key="goods.id">
					<h4><router-link :to="'/detail?id='+goods.id">{{goods.name}}</router-link></h4>
					<router-link :to="'/detail?id='+goods.id"><img :src="'http://127.0.0.1:8000'+goods.pic"></router-link>
					<div class="prize">¥ {{goods.price}}</div>
				</li>
			</ul>
		</div>
	</div> 

	<MyCertification></MyCertification>

	
  </div>
</template>


<script>

import myheader from './common/Header'
import mycertification from './common/Certification'
export default {
	components:{
		//标签名:组件
		"MyHeader":myheader,
		'MyCertification':mycertification
	},
	data(){
		return{
			data_list:[],
		}
	},created(){
		this.axios.get('/index').then(resp=>{
			console.log(resp.data)
			this.data_list=resp.data
		}).catch(error=>{  
			console.log(error)
		})
	}
}
</script>

<style>

</style>